package com.battle.service.controller.web;

import com.battle.service.config.IceConfig;
import com.battle.service.service.in.AliyunService;
import nirvana.core.domains.vo.ApiResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: IceSea
 * @Date: 2022/11/28 9:51 AM
 */
@RestController
@RequestMapping("api/oss")
public class OssController {
    @Autowired
    private AliyunService aliyunService;
    @Autowired
    private IceConfig iceConfig;

    @GetMapping("getOssKeySecret")
    public Object getOssKeySecret() {
        return ApiResult.ok(aliyunService.getUploadCredentials(iceConfig.getAliyunDefaultDomain(),
                iceConfig.getAliyunDefaultBucket()));
    }
}
